package com.mobile.renter.skins {
   import spark.components.Form;
   import spark.core.SpriteVisualElement;
   import spark.skins.mobile.SkinnableContainerSkin;
   
   public class FormSkin extends SkinnableContainerSkin {
      protected var backgroundClass:Class;
      
      protected var background:SpriteVisualElement;
      
      public function FormSkin() {
         super();
         backgroundClass = FormBackGround;
      }
      
      override protected function createChildren():void {
         // Adding container background
         background = new backgroundClass;
         addChild(background);
         
         // Creating content group instance
         super.createChildren();
      }
      
      override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void {
         super.layoutContents(unscaledWidth, unscaledHeight);
         
         // Setting size of background container
         setElementSize(background, unscaledWidth, unscaledHeight);
      }
      
      override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void {
         // By default SkinnableContainerSkin draws Rect with backgroundColor but this is not
         // required in this case since background is constructed of MySkinnableContainerBackground fxg
      }
   }
}